//画海报
function getDraw(zhutu, xiaoshoujia, goodsname, twoCodeUrl) {
  return {
    width: '750rpx',
    height: '1050rpx',
    borderRadius: '10rpx',
    views: [{
        type: 'rect',
        css: {
          top: '30rpx',
          left: '80rpx',
          width: '590rpx',
          height: '1050rpx',
          borderRadius: '10rpx',
          color: '#eee',
        },
      },
      {
        type: 'image',
        url: zhutu,
        css: {
          top: '50rpx',
          left: '100rpx',
          width: '550rpx',
          height: '550rpx',
          mode: "aspectFill"
        },
      }, {
        type: 'text',
        text: '￥' + xiaoshoujia,
        css: {
          top: '620rpx',
          left: '100rpx',
          fontSize: '36rpx',
          color: '#FF0000'
        },
      }, {
        type: 'text',
        text: goodsname,
        css: {
          top: '680rpx',
          left: '110rpx',
          width: '520rpx',
          fontSize: '36rpx',
          lineHeight: '44rpx',
          maxLines: 3
        },
      }, {
        type: 'image',
        url: twoCodeUrl,
        css: {
          top: '830rpx',
          left: '110rpx',
          width: '180rpx',
          height: '180rpx',
          mode: "aspectFill"
        },
      }, {
        type: 'text',
        text: '长按立即购买',
        css: {
          top: '910rpx',
          left: '320rpx',
          width: '220rpx',
          fontSize: '28rpx',
          lineHeight: '30rpx',
          maxLines: 1,
          color: '#747373',
        },
      }
    ],
  }
}
//画海报（营销活动：团购、拼团、秒杀）
function getMarketingDraw(zhutu, marketingprice,xiaoshoujia, goodsname, twoCodeUrl) {
  return {
    width: '750rpx',
    height: '1050rpx',
    borderRadius: '10rpx',
    views: [{
        type: 'rect',
        css: {
          top: '30rpx',
          left: '80rpx',
          width: '590rpx',
          height: '1050rpx',
          borderRadius: '10rpx',
          color: '#eee',
        },
      },
      {
        type: 'image',
        url: zhutu,
        css: {
          top: '50rpx',
          left: '100rpx',
          width: '550rpx',
          height: '550rpx',
          mode: "aspectFill"
        },
      }, {
        type: 'text',
        text: goodsname,
        css: {
          top: '660rpx',
          left: '110rpx',
          width: '520rpx',
          fontSize: '36rpx',
          lineHeight: '44rpx',
          maxLines: 3
        },
      }, {
        type: 'text',
        text: '￥' + marketingprice,
        css: {
          top: '840rpx',
          left: '100rpx',
          fontSize: '56rpx',
          color: '#FF0000'
        },
      }, {
        type: 'text',
        text: '原价：￥' + xiaoshoujia,
        css: {
          top: '910rpx',
          left: '116rpx',
          fontSize: '26rpx',
          color: '#747373',
          textDecoration: 'line-through'
        },
      }, {
        type: 'image',
        url: twoCodeUrl,
        css: {
          top: '790rpx',
          left: '470rpx',
          width: '180rpx',
          height: '180rpx',
          mode: "aspectFill"
        },
      }, {
        type: 'text',
        text: '长按立即购买',
        css: {
          top: '980rpx',
          left: '490rpx',
          width: '520rpx',
          fontSize: '24rpx',
          lineHeight: '30rpx',
          maxLines: 1,
          color: '#747373',
        },
      }
    ],
  }
}
//画分销整站推广海报
function getfenxiaoDraw(dianpuzhaopian, dianpuname, avatarUrl, nickname, jianjie, twoCodeUrl) {
  return {
    width: '750rpx',
    height: '1050rpx',
    borderRadius: '10rpx',
    views: [{
        type: 'rect',
        css: {
          top: '30rpx',
          left: '80rpx',
          width: '590rpx',
          height: '1050rpx',
          borderRadius: '10rpx',
          color: '#eee',
        },
      },
      {
        type: 'image',
        url: dianpuzhaopian,
        css: {
          top: '30rpx',
          left: '80rpx',
          width: '590rpx',
          height: '590rpx',
          mode: "aspectFill"
        },
      }, {
        type: 'text',
        text: dianpuname,
        css: {
          top: '650rpx',
          width: '550rpx',
          maxLines: 1,
          fontSize: '36rpx',
          textAlign: 'center',
          fontWeight: 'bold'
        },
      }, {
        type: 'image',
        url: avatarUrl,
        css: {
          top: '80rpx',
          left: '120rpx',
          width: '100rpx',
          height: '100rpx',
          mode: "aspectFill",
          borderRadius: '100%'
        }
      }, {
        type: 'text',
        text: nickname,
        css: {
          top: '110rpx',
          width: '200rpx',
          left: '170rpx',
          maxLines: 1,
          fontSize: '24rpx',
          textAlign: 'center',
          fontWeight: 'bold'
        }
      }, {
        type: 'text',
        text: jianjie,
        css: {
          top: '750rpx',
          width: '320rpx',
          height: '20rpx',
          lineHeight: '36rpx',
          maxLines: 6,
          left: '100rpx',
          fontSize: '26rpx',
          textAlign: 'left',
          fontWeight: 'bold'
        }
      }, {
        type: 'image',
        url: twoCodeUrl,
        css: {
          top: '730rpx',
          left: '460rpx',
          width: '180rpx',
          height: '180rpx',
          mode: "aspectFill"
        }
      }, {
        type: 'text',
        text: '长按二维码查看详情',
        css: {
          top: '950rpx',
          width: '200rpx',
          height: '20rpx',
          maxLines: 2,
          left: '450rpx',
          fontSize: '20rpx',
          textAlign: 'center',
          fontWeight: 'bold'
        }
      }
    ],
  }
}

module.exports = {
  getDraw,
  getMarketingDraw,
  getfenxiaoDraw
};